"""
清空缓存文件夹
"""
from pathlib import Path
import shutil


def purge_cache(path):
    # 遍历目录下所有文件
    for item in path.rglob('*'):
        if not item.is_dir():
            continue
        if item.name == '__pycache__':
            shutil.rmtree(item)


if __name__ == "__main__":
    root_dir = Path(__file__).parent.parent
    purge_cache(root_dir)
